package gagak.framework.web.paramresovler;

import gagak.framework.web.param.MethodParameter;
import gagak.framework.web.support.request.NativeWebRequest;

import javax.servlet.http.HttpServletRequest;

/*
 * @program: ce
 * @description: 抽象参数解析器
 * @author: houhong
 * @create: 2022-11-25 20:14
 */
public abstract class AbstractParamResolver implements HandlerMethodArgumentResolver {

    @Override
    public boolean supportsParameter(MethodParameter parameter) {
        return Boolean.TRUE;
    }

    /*
     * 基本数据类型
     */
    protected static Class<?>[] DEFAULT_DATA_TYPE_LIST
            = new Class[]{
            String.class, Boolean.class, Short.class, Double.class, Long.class, Integer.class
            , Float.class, Character.class
    };

    //// TODO: 2022/12/1
    @Override
    public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest request) {
        return null;
    }


    /*
     * 抽象方法，用于子类实现
     */
    protected abstract Object resolveName(MethodParameter parameter, HttpServletRequest request, String name);
}